<?php

use think\Cache;
use think\migration\Seeder;

class AddBackendMenu extends Seeder
{
    /**
     * Run Method.
     *
     * Write your database seeder using this method.
     *
     * More information on writing seeders is available here:
     * http://docs.phinx.org/en/latest/seeding.html
     */
    public function run()
    {
        $rows = [
            ['id' => 56, 'icon' => "fa-certificate", "name" => "公司管理", "url" => "/admin/company/index", "pid" => 2, "sort" => 1, "level" => 2, "status" => 1, "is_show" => 1, "update_time" => time(), 'create_time' => time()],
            ['id' => 57, 'icon' => "fa-cubes", "name" => "部门管理", "url" => "/admin/department/index", "pid" => 56, "sort" => 1, "level" => 2, "status" => 1, "is_show" => 1, "update_time" => time(), 'create_time' => time()],
            ['id' => 58, 'icon' => "fa-cube", "name" => "职位管理", "url" => "/admin/position/index", "pid" => 56, "sort" => 1, "level" => 2, "status" => 1, "is_show" => 1, "update_time" => time(), 'create_time' => time()],
        ];

        $this->table("menu")->insert($rows)->save();
        Cache::clear();
    }
}